import os

db_uri = 'mysql+pymysql://peter:whnb@127.0.0.1:3306/apidb'

class Config(object):
    SQLALCHEMY_DATABASE_URI = db_uri
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_ECHO = True

    SECRET_KEY = 'hafglrruihf'

    BASE_DIR = os.path.abspath(os.path.dirname(__file__))
    STATIC_DIR = os.path.join(BASE_DIR, 'static')
    UPLOAD_ICON_DIR = os.path.join(STATIC_DIR, 'upload/icon')

class DevelopmentConfig(Config):
    ENV = 'development'
    DEBUG = True

class ProductionConfig(Config):
    ENV = 'production'
    DEBUG = False



if __name__ == '__main__':
    print(Config.BASE_DIR)
    print(Config.STATIC_DIR)
    print(Config.UPLOAD_ICON_DIR)